package com.homeparking.manage.service.impl;

import java.util.List;
import com.homeparking.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.homeparking.manage.mapper.ImgSwiperMapper;
import com.homeparking.manage.domain.ImgSwiper;
import com.homeparking.manage.service.IImgSwiperService;

/**
 * 页面轮播图Service业务层处理
 * 
 * @author liuyangyang
 * @date 2025-07-12
 */
@Service
public class ImgSwiperServiceImpl implements IImgSwiperService 
{
    @Autowired
    private ImgSwiperMapper imgSwiperMapper;

    /**
     * 查询页面轮播图
     * 
     * @param imgId 页面轮播图主键
     * @return 页面轮播图
     */
    @Override
    public ImgSwiper selectImgSwiperByImgId(Long imgId)
    {
        return imgSwiperMapper.selectImgSwiperByImgId(imgId);
    }

    /**
     * 查询页面轮播图列表
     * 
     * @param imgSwiper 页面轮播图
     * @return 页面轮播图
     */
    @Override
    public List<ImgSwiper> selectImgSwiperList(ImgSwiper imgSwiper)
    {
        return imgSwiperMapper.selectImgSwiperList(imgSwiper);
    }

    /**
     * 新增页面轮播图
     * 
     * @param imgSwiper 页面轮播图
     * @return 结果
     */
    @Override
    public int insertImgSwiper(ImgSwiper imgSwiper)
    {
        imgSwiper.setCreateTime(DateUtils.getNowDate());
        return imgSwiperMapper.insertImgSwiper(imgSwiper);
    }

    /**
     * 修改页面轮播图
     * 
     * @param imgSwiper 页面轮播图
     * @return 结果
     */
    @Override
    public int updateImgSwiper(ImgSwiper imgSwiper)
    {
        imgSwiper.setUpdateTime(DateUtils.getNowDate());
        return imgSwiperMapper.updateImgSwiper(imgSwiper);
    }

    /**
     * 批量删除页面轮播图
     * 
     * @param imgIds 需要删除的页面轮播图主键
     * @return 结果
     */
    @Override
    public int deleteImgSwiperByImgIds(Long[] imgIds)
    {
        return imgSwiperMapper.deleteImgSwiperByImgIds(imgIds);
    }

    /**
     * 删除页面轮播图信息
     * 
     * @param imgId 页面轮播图主键
     * @return 结果
     */
    @Override
    public int deleteImgSwiperByImgId(Long imgId)
    {
        return imgSwiperMapper.deleteImgSwiperByImgId(imgId);
    }
}
